<CFQUERY NAME="getclient" DATASOURCE="#dsn#">
select *
from tblcustomers
where CustomerNum = <cfqueryparam cfsqltype="cf_sql_integer" value="#accountnumber#">

</CFQUERY>
<cfoutput>
<cfset today = dateformat(now(), "yyyy/mm/dd")>
<CFSET new_date = #CREATEODBCDATETIME(today)#>
</cfoutput>


<CFQUERY NAME="getorders" DATASOURCE="#dsn#">
select *
from tblpayments
<cfif isdefined("form.ReceiptNum")>where ReceiptNum = #ReceiptNum#<cfelse>where TransDate >= #new_date#</cfif>
</CFQUERY>



<CFQUERY NAME="getitemssum" DATASOURCE="#dsn#">
select sum(Amount) as total
from tblpayments
<cfif isdefined("form.ReceiptNum")>where ReceiptNum = #ReceiptNum#<cfelse>where TransDate >= #new_date#</cfif>
</CFQUERY>

<CFQUERY NAME="gettaxsum" DATASOURCE="#dsn#">
select sum(TaxAmount) as total
from tbltransactions, tblorders
where tbltransactions.ReceiptNum = tblorders.ReceiptNum and <cfif isdefined("form.ReceiptNum")>tblorders.ReceiptNum = #ReceiptNum#<cfelse>tblorders.TransDate >= #new_date#</cfif>
</CFQUERY>

<CFQUERY NAME="getpie1" DATASOURCE="#dsn#">
select sum(Cash) as cashtotal, sum(Credit) as credittotal, sum(Check) as checktotal, sum(GiftCard) as gifttotal
from tblpayments
<cfif isdefined("form.ReceiptNum")>where ReceiptNum = #ReceiptNum#<cfelse>where TransDate >= #new_date#</cfif>
</CFQUERY>

<cfoutput>
<cfif #getpie1.cashtotal# lte 0>
<cfset getpie1.cashtotal = 0>
</cfif>

<cfif #getpie1.credittotal# lte 0>
<cfset getpie1.credittotal = 0>
</cfif>

<cfif #getpie1.checktotal# lte 0>
<cfset getpie1.checktotal = 0>
</cfif>

<cfif #getpie1.gifttotal# lte 0>
<cfset getpie1.gifttotal = 0>
</cfif>


</cfoutput>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#container {
	width:650px;
	height:450px;
	text-align:center;
}
#myform {
	position:relative;
	float:left;
	top:4px;
	width:648px;
	height:53px;
	z-index:1;
	text-align:left;
	left: 0;
}
.style1 {font-size:18px;
color:#000;
}
#items {
	position:relative;
	float:left;
	top:10px;
	width:648px;
	height:300px;
	z-index:2;
	overflow: hidden;
	left: 0;
}
body,td,th {
	font-family: Verdana, Geneva, sans-serif;
	font-size: 12px;
}
#total {
	position:relative;
	float:left;
	top:50px;
	width:648px;
	height:50px;
	z-index:3;
	left: 0;
}
	
-->
</style></head>

<body onLoad="document.form1.ProdID.focus()" background-repeat:repeat-x;margin:0px auto;text-align:left; bgcolor="#FFFFFF">



<div id="container"><div id="myform">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="46%" valign="middle"><cfoutput>
      <cfform name="form1" id="form1" method="post" action="../transactions.cfm">
    <label>
      <span class="style1">Search Receipt Num:</span>
      <cfinput type="text" name="ReceiptNum" class="style1" style="border-color:transparent; background-color:##eeeeee" size="5" onblur="form1.submit()">
    </label>
  </cfform></cfoutput></td>
    <td width="54%" align="right"><cfoutput>Today Date: #dateformat(today, "dddd, mmmm dd yyyy")#</cfoutput></td>
  </tr>
</table>

</div>
  <div id="items">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><cfoutput>
<CFCHART show3D="yes" chartWidth="280" chartHeight="260" databackgroundcolor="##91c0d8" format="flash" foregroundcolor="##006699" xaxistitle="Transactions">
                  <CFCHARTSERIES type="pie">
                  <CFCHARTDATA ITEM="Cash" value=#getpie1.cashtotal#>
                  <CFCHARTDATA ITEM="Credit Card" value=#getpie1.credittotal#>
                  <CFCHARTDATA ITEM="Check" value=#getpie1.checktotal#>
                  <CFCHARTDATA ITEM="Gift Card" value=#getpie1.gifttotal#>
                  </CFCHARTSERIES>
        </CFCHART></cfoutput></td>
    <td align="center"><cfoutput>
<CFCHART show3D="yes" chartWidth="280" chartHeight="260" databackgroundcolor="##91c0d8" format="flash" foregroundcolor="##006699" xaxistitle="Today's Transactions">
                  <CFCHARTSERIES type="bar">
                  <CFCHARTDATA ITEM="Cash" value=#getpie1.cashtotal#>
                  <CFCHARTDATA ITEM="Credit Card" value=#getpie1.credittotal#>
                  <CFCHARTDATA ITEM="Check" value=#getpie1.checktotal#>
                  <CFCHARTDATA ITEM="Gift Card" value=#getpie1.gifttotal#>
                  </CFCHARTSERIES>
        </CFCHART></cfoutput></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

  </div>
  <div id="total">
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr class="style1">
    <td width="20%" height="35">&nbsp;</td>
    <td width="47%" height="35" align="right">Total Tax:</td>
    <td width="9%" height="35" align="left"><strong><cfoutput><CFIF #gettaxsum.total# lte 0>$0.00<cfelse>#LSCURRENCYFORMAT(gettaxsum.total)#</CFIF></cfoutput></strong></td>
    <td width="12%" height="35" align="right">Total: </td>
    <td width="12%" height="35" align="left"><strong><cfoutput><CFIF #getitemssum.total# lte 0>$0.00<cfelse>#LSCURRENCYFORMAT(getitemssum.total)#</CFIF></cfoutput></strong></td>
  </tr>
</table>
</div>
</div>
</body>
</html>